package com.ncmmall.domain.business.distribution;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import javax.persistence.*;

/**
 * 分销商品-相应等级分销商的分销比例
 */
@Entity
@Table(name = "distribution_goods_level")
@Access(AccessType.FIELD)
@Getter
@Setter
@ToString
@EqualsAndHashCode
@Accessors(chain = true)
public class DistributionGoodsLevel {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 分销商品
     */
    @OneToOne
    private DistributionGoods distributionGoods;

    /**
     * 分销商等级
     */
    private int level;

    /**
     * 一级分佣比例
     */
    private Double firstLevelScale;

    /**
     * 二级分佣比例
     */
    private Double secondLevelScale;

    @Transient
    @JsonIgnore
    private String levelName;

    @Transient
    @JsonIgnore
    private Integer first;

    @Transient
    @JsonIgnore
    private Integer second;

}
